<?php

namespace Database\Seeders;

use App\Kuafu\User\Model\Permissions;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class PermissionsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $insertArr = [
            // 菜品库
            ['id' => 1, 'menuId' => 4, 'name' => '添加', 'action' => 'b.product.addProduct', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 2, 'menuId' => 4, 'name' => '删除', 'action' => 'b.product.deletedProduct', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 3, 'menuId' => 4, 'name' => '修改', 'action' => 'b.product.setProductById', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],

            //
            ['id' => 4, 'menuId' => 5, 'name' => '修改', 'action' => 'b.product.demo', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 5, 'menuId' => 6, 'name' => '修改', 'action' => 'b.product.demo', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 6, 'menuId' => 7, 'name' => '修改', 'action' => 'b.product.demo', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 7, 'menuId' => 8, 'name' => '修改', 'action' => 'b.product.demo', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 8, 'menuId' => 2, 'name' => '修改', 'action' => 'b.product.demo', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['id' => 9, 'menuId' => 2, 'name' => '修改', 'action' => 'b.product.demo', 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],


        ];

        $table = Permissions::query()->getModel()->getTable();
        DB::table($table)->truncate();
        DB::table($table)->insert($insertArr);
    }
}
